Skip to content

fix: Export PgTyped.res.mjs for ReScript consumers - #33

Open
Bushuo wants to merge 1 commit into
zth:rescriptfrom
Bushuo:fix/export-pgtyped-res-mjs
Open

Bushuo wants to merge 1 commit into
zth:rescriptfrom
Bushuo:fix/export-pgtyped-res-mjs

Conversation

@Bushuo

@Bushuo Bushuo commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

  • ReScript 12 compiles dependents to import ... from "pgtyped-rescript/src/res/PgTyped.res.mjs".
  • The current exports map routes all ./* subpaths to lib/index.js, so Node rejects that import under the package export map.
  • Add an explicit export for ./src/res/PgTyped.res.mjs. Tested locally as a pnpm patch.

Test plan

  • Install pgtyped-rescript in a ReScript 12 project that depends on it and uses PgTyped (pool/client APIs).
  • Confirm Node can resolve pgtyped-rescript/src/res/PgTyped.res.mjs without ERR_PACKAGE_PATH_NOT_EXPORTED.
  • Confirm the CLI (pgtyped-rescript) still runs.

The package exports map currently sends every subpath to
lib/index.js, so Node cannot load the compiled ReScript
runtime at src/res/PgTyped.res.mjs. ReScript 12 emits imports
to that path; open the subpath so dependent packages resolve.

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant